import 'package:flutter/material.dart';

class ModalBottom {
  BuildContext context;

  Future<int> showCustomModalBottomSheet(context, Widget Content) async {
    return showModalBottomSheet<int>(
      backgroundColor: Colors.transparent,
      isScrollControlled: true,
      context: context,
      builder: (BuildContext context) {
        return Container(
          clipBehavior: Clip.antiAlias,
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.only(
              topLeft: const Radius.circular(20.0),
              topRight: const Radius.circular(20.0),
            ),
          ),
          height: MediaQuery.of(context).size.height * 0.515,
          child: Column(children: [
            SizedBox(
              height: 50,
              child: Stack(
                textDirection: TextDirection.rtl,
                children: [
                  Center(
                    child: Text(
                      '底部弹窗',
                      style: TextStyle(
                          fontWeight: FontWeight.bold, fontSize: 16.0),
                    ),
                  ),
                  IconButton(
                      icon: Icon(Icons.close),
                      onPressed: () {
                        Navigator.of(context).pop();
                      }),
                ],
              ),
            ),
            Divider(height: 1.0),
            Expanded(child: Content)
            // Expanded(
            //   child: ListView.builder(
            //     itemBuilder: (BuildContext context, int index) {
            //       return ListTile(
            //           title: Text(options[index]),
            //           onTap: () {
            //             Navigator.of(context).pop(index);
            //           });
            //     },
            //     itemCount: options.length,
            //   ),
            // ),
          ]),
        );
      },
    );
  }
}
